<template>
  <div class="bg-white rounded-lg p-5 h-full flex flex-col">
    <div>
      <div class="font-bold text-lg mb-4">查看人员</div>
      <el-form :model="formData" :inline="true" ref="queryForm">
        <el-form-item prop="personnelName">
          <el-input
            v-model="formData.personnelName"
            placeholder="人员姓名"
          ></el-input>
        </el-form-item>
        <div class="">
          <el-button type="primary" @click="search">查询</el-button>
          <el-button @click="reset">重置</el-button>
        </div>
      </el-form>
      <hr class="my-4" />
      <el-table :data="dataList" border>
        <el-table-column type="index" label="序号" width="55" align="center">
        </el-table-column>
        <el-table-column prop="personnelName" label="人员名称">
        </el-table-column>
        <el-table-column prop="identityNumber" label="身份证">
        </el-table-column>
        <el-table-column prop="issueDate" label="发证日期"> </el-table-column>
        <el-table-column prop="trainingStatus" label="是否参加年度培训">
        </el-table-column>
        <el-table-column prop="trainingTime" label="培训日期">
        </el-table-column>
      </el-table>
    </div>
    <hr class="mt-auto mb-4" />
    <div class="flex justify-end">
      <el-button type="primary" @click="goBack">返回</el-button>
    </div>
  </div>
</template>

<script>
import { getMajorListAPI } from "@/api/zhangping/health-care/prevent-vaccinate";
export default {
  data() {
    return {
      formData: {
        pageNum: 1,
        pageSize: 10,
        personnelName: null,
      },
      dataList: [],
      pageSize: 10,
      total: 1000,
      data4Map: {
        0: "是",
        1: "否",
      },
    };
  },
  mounted() {
    this.getDataList();
  },
  methods: {
    handleCurrentChange() {},
    handleSizeChange() {},
    reset() {
      this.$refs.queryForm.resetFields();
      this.search();
    },
    async() {},
    search() {
      this.formData.pageNum = 1;
      this.getDataList();
    },
    goBack() {
      this.$router.back();
    },
    getDataList() {
      this.loading = true;

      getMajorListAPI(this.formData)
        .then((res) => {
          debugger;
          this.dataList = res.rows;
          this.total = res.total;
        })
        .finally(() => {
          this.loading = false;
        });
    },
  },
};
</script>

<style lang="scss" scoped></style>
